<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var day = prompt("请输入几号");
        if (day % 7 == 0) {
            alert("为星期天")
        } else if (day % 7 == 1) {
            alert("为星期1")
        } else if (day % 7 == 2) {
            alert("为星期2")
        } else if (day % 7 == 3) {
            alert("为星期3")
        } else if (day % 7 == 4) {
            alert("为星期4")
        } else if (day % 7 == 5) {
            alert("为星期5")
        } else if (day % 7 == 6) {
            alert("为星期6")
        }
    </script>
</body>

</html>